<?php
!defined('LZ_MODULE') && die('Access Denied');
include_once('model/photo_album.php');
$album = new LZ_Photo_Album;
include_once('model/photo.php');
$photo = new LZ_Photo;

//cache_this_page();

// big photo
$view_data['index_big_photos'] = array();
$arr = $album->get_one_by_name('index_big_photos');
if ($arr && $arr['photo_ids'])
{
	$arr = explode(',',$arr['photo_ids']);
	foreach($arr as $_id)
	{
		$_id = intval($_id);
		if ($_id) $_big_photo = $photo->get_one($_id);
		if ($_big_photo) $view_data['index_big_photos'][] = $_big_photo;
	}
}
$view_data['index_big_photos_json'] = json_encode($view_data['index_big_photos']);

//small photo
$view_data['most_downloaded'] = $photo->get_list( array('order'=>'downloaded' ,'total'=>5,'status'=>1) );
$view_data['newly_uploaded'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5,'status'=>1) );


$view_data['abroad'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>9) );
$view_data['cooperation'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>11) );
$view_data['life'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>12) );
$view_data['people'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>13) );
$view_data['news'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>14) );
$view_data['ideas'] = $photo->get_list( array('order'=>'update_time' ,'total'=>5000,'status'=>1 ,'category_id'=>15) );



$view_data['images']=$photo->get_list(array('order'=>'update_time','totla'=>5000,'status'=>1,'category_id'=>12) );
$view_data['title'] = TITLE;
include_once('controller/left.php');
?>